{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'error': 'Rate limit error...', 'response': \"{'message': 'You have exceeded the MONTHLY quota for Requests on your current plan, BASIC. Upgrade your plan at https://rapidapi.com/s.mahmoud97/api/airdna1'}\"}\n"
     ]
    }
   ],
   "source": [
    "import time\n",
    "import requests\n",
    "import json\n",
    "\n",
    "time.sleep(2) # rate limit: 30 per minute\n",
    "headers = {\"toolbench_key\": \"Efcj326JSFjLVFL8T49aMJkqH70B5PQLwvbGSRc5Ds0OkrfquD\"}\n",
    "\n",
    "# pure_api_name = self.api_name_reflect[function[\"name\"]]\n",
    "payload = {\n",
    "    \"category\":\"Data\",\n",
    "    \"tool_name\": 'airdna',\n",
    "    \"api_name\": 'rental_ratings',\n",
    "    \"tool_input\": {\"location\":\"Santa Cluze\"},\n",
    "    \"strip\": \"truncate\",\n",
    "    \"toolbench_key\": \"Efcj326JSFjLVFL8T49aMJkqH70B5PQLwvbGSRc5Ds0OkrfquD\"\n",
    "}\n",
    "response = requests.post(\"http://8.218.239.54:8080/rapidapi\", json=payload, headers=headers, timeout=15)\n",
    "print(response.json())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "weizhou_tool",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.11"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
